import commands,array

Linux = [["Novell SUSE","/etc/SUSE-release"],
["Red Hat","/etc/redhat-release","/etc/redhat_version" ],
["Fedora","/etc/fedora-release" ],
["Slackware","/etc/slackware-release","/etc/slackware-version" ],
["Debian","/etc/debian_release","/etc/debian_version" ],
["Mandrake","/etc/mandrake-release"],
["Yellow dog","/etc/yellowdog-release"],
["Sun JDS","/etc/sun-release"],
["Solaris/Sparc","/etc/release"],
["Gentoo","/etc/gentoo-release"],
["UnitedLinux","/etc/UnitedLinux-release"],
["Ubuntu","/etc/lsb-release"]]

def Linux_Soported_List():
	for i in range(len(Linux)):
		print Linux[i][1]

def Look_Linux():
	Index = -1
	for i in range(len(Linux)):
		for j in range(1,len(Linux[i])):
			resultado = commands.getoutput("ls " + Linux[i][j])
			if resultado.strip() == Linux[i][j].strip():
				Index = i
				File = j
	resultado = commands.getoutput("cat " + Linux[Index][File])
	print "Distribucion Linux que usa", Linux[Index][0] , resultado
	
if __name__ == "__main__":
	print "Modulo Linux cargado correctamente.."
	Linux_Soported_List()
	print "\n"
	Look_Linux()
